package com.jcfy.framework.base;


import org.springframework.beans.factory.annotation.Autowired;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

public class BaseServiceImpl<M extends BaseMapper<T>, T> implements BaseService<T> {

	@Autowired
	private M baseMapper;

	public BaseServiceImpl() {
	}

	public M getBaseMapper() {
		return this.baseMapper;
	}

	@Override
	public int add(T record) {
		return baseMapper.add(record);
	}

	@Override
	public int addAll(List<T> list) {
		return baseMapper.addAll(list);
	}

	@Override
	public int del(Serializable id) {
		return baseMapper.del(id);
	}

	@Override
	public int delAll(List<Serializable> ids) {
		return baseMapper.delAll(ids);
	}

	@Override
	public int update(T record) {
		return baseMapper.update(record);
	}

	@Override
	public T getById(Serializable id) {
		return baseMapper.getById(id);
	}

	@Override
	public  List<T> getByIds(List<Serializable> ids) {
		return baseMapper.getByIds(ids);
	}

	@Override
	public List<T> getAll() {
		return baseMapper.getAll();
	}

	@Override
	public List<T> getByParams(Map<String, Object> params) {
		return baseMapper.getByParams(params);
	}
	
//	@Override
//	public List<T> getPage(Page<T> page) {
//		return baseMapper.getPage(page);
//	}
	
	@Override
	public int getCount(Map<String, Object> params) {
		return baseMapper.getCount(params);
	}
	
}
